package com.nb.service.impl;

import com.nb.dao.UserDao;
import com.nb.domain.User;
import com.nb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户业务实现
 * Created by fly on 2017/11/12.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    /**
     * 根据用户主键获取用户信息
     * @param userId
     * @return
     * @throws Exception
     */
    public User findUserById(int userId) throws Exception {
        return userDao.findUserById(userId);
    }

    /**
     * 获取用户列表
     * @return
     * @throws Exception
     */
    public List<User> queryUserList() throws Exception {
        return userDao.queryUserList();
    }
}
